//
//  NormalGoalItemModel.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/12.
//

import Foundation
import HandyJSON

class GoalSetupPickerModel: HandyJSON {
    var unit: String = ""
    var pickerDataArray: [String] = []
    var selectIndex: Int = 0
    var pickerWidth: Float = 0.0
    
    required init() { }
    init(unit: String, pickerDataArray: [String], selectIndex: Int, pickerWidth: Float) {
        self.unit = unit
        self.pickerDataArray = pickerDataArray
        self.selectIndex = selectIndex
        self.pickerWidth = pickerWidth
    }
}

class GoalSetupNormalItemModel: HandyJSON {
    var title: String = ""
    var pickerModel: GoalSetupPickerModel = GoalSetupPickerModel()
    var hourPickerModel: GoalSetupPickerModel = GoalSetupPickerModel()
    
    required init() { }
    init(title: String, pickerModel: GoalSetupPickerModel, hourPickerModel: GoalSetupPickerModel = GoalSetupPickerModel()) {
        self.title = title
        self.pickerModel = pickerModel
        self.hourPickerModel = hourPickerModel
    }
}

class NormalGoalModel: HandyJSON {
    
    var trainingModel: GoalSetupNormalItemModel = GoalSetupNormalItemModel()
    var kcalModel: GoalSetupNormalItemModel = GoalSetupNormalItemModel()
    var durationModel: GoalSetupNormalItemModel = GoalSetupNormalItemModel()
    
    required init() { }
    init(trainingModel: GoalSetupNormalItemModel, kcalModel: GoalSetupNormalItemModel, durationModel: GoalSetupNormalItemModel) {
        self.trainingModel = trainingModel
        self.kcalModel = kcalModel
        self.durationModel = durationModel
    }
}

class WeeksGoalModel: HandyJSON {
    var isOpen: Bool = false
    var weeks: [Int] = []
    var goalModel: NormalGoalModel = NormalGoalModel()
    
    required init() { }
    init(isOpen: Bool = false, weeks: [Int] = [], goalModel: NormalGoalModel) {
        self.isOpen = isOpen
        self.weeks = weeks
        self.goalModel = goalModel
    }
}

class GoalSetupModel: NSObject {
    var normalGoal: NormalGoalModel = NormalGoalModel()
    var weeksGoal: WeeksGoalModel = WeeksGoalModel()
}
